package com.ljcalc.business.components.requests;

public class HistoryResultRequest extends HTTPUserRequest {

	protected int type = 0;
	protected int year = 0;
	protected int round = 0;
	
	public HistoryResultRequest(String url) {
		super(url);
	}
	
	public HistoryResultRequest(int type, int year, int round) {
		super("");
		this.type = type;
		this.year = year;
		this.round = round;
	
	}

	public int getType() {
		return type;
	}

	public int getYear() {
		return year;
	}

	public int getRound() {
		return round;
	}
	
	/**
	 * 
	 * @param hrr
	 * @return 0 same, -1 earlier, 1 later
	 */
	public int compareTo(HistoryResultRequest hrr){
		if(this.getYear()>hrr.getYear()){
			return 1;
		}else if(this.getYear()<hrr.getYear()){
			return -1;
		}
		//same year
		if(this.getRound()>hrr.getRound()){
			return 1;
		}else if(this.getRound()<hrr.getRound()){
			return -1;
		}
		return 0;
		
	}
}
